# def greet_user(user_name):
#     """显示简单的问候语"""
#     print(f"Hello, {user_name.title()}!")

# greet_user('jesse')

##################结合使用函数和while循环#######################

def get_formatted_name(first_name, last_name):
    """返回整洁的姓名"""
    return f"{first_name} {last_name}".title()


while True:
    print("\nPlease tell me your name:")
    print("(enter 'q' at any time to quit)")

    f_name = input("First name: ")
    if f_name == 'q':
        break
    l_name = input("Last name: ")
    if l_name == 'q':
        break

    formatted_name = get_formatted_name(f_name, l_name)
    print(f"\nHello, {formatted_name}!")
